package com.zy.springcloud.movie.controller;

import com.zy.springcloud.movie.bean.Movie;
import com.zy.springcloud.movie.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zy 690748807@qq.com
 * @Description: TODO
 * @Date: 2024/3/30 14:09
 * @Version: 1.0
 * @name 方法名字：
 */
@RestController
public class MovieController {

    @Autowired
    MovieService movieService;
    @Value("${server.port}")
    int port;
    @RequestMapping("/getmovie/{id}")
    public Movie getNewMovie(@PathVariable("id") Integer id) {
        System.out.println("===movie======服务器的端口号是：========"+port+"===========");
        Movie movie = movieService.getNewMovie(id);
        return movie;
    }
}
